<html>
<head><meta charset="utf-8"><title>perf stress test broken · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html">perf stress test broken</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="191651948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191651948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191651948">(Mar 24 2020 at 18:15)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0080]: could not evaluate static initializer
  --&gt; src/lib.rs:53:35
   |
25 |         e(0); e(0); e(0); e(0);
   |                     ---- inside call to `CONST_FN::e::e::e::e` at src/lib.rs:25:21
26 |         e(0); e(0); e(0); e(0)
   |               ----  ---- inside call to `CONST_FN::e::e::e` at src/lib.rs:26:21
   |               |
   |               inside call to `CONST_FN::e::e` at src/lib.rs:26:15
...
32 |         e(0); e(0); e(0); e(0)
   |         ---- inside call to `CONST_FN::e` at src/lib.rs:32:9
...
53 | const fn inc(i: i32) -&gt; i32 { i + 1 }
   |                                   ^ exceeded interpreter step limit (see `#[const_eval_limit]`)
...
58 | expensive_static!(CONST_FN: i32 = inc(42); [8 16 16 16 16]);
   |                                   ------- inside call to `inc` at src/lib.rs:58:35
</pre></div>


<p>on the perf ctfe-stress-4 benchmark</p>



<a name="191651970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191651970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191651970">(Mar 24 2020 at 18:15)</a>:</h4>
<p>Should we bump up the step limit? cc <span class="user-mention" data-user-id="124288">@oli</span> <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> (?)</p>



<a name="191652035"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652035" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652035">(Mar 24 2020 at 18:16)</a>:</h4>
<p>Did this go over the limit recently?</p>



<a name="191652126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652126">(Mar 24 2020 at 18:17)</a>:</h4>
<p>uh, yeah, in the past day or two</p>



<a name="191652142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652142">(Mar 24 2020 at 18:17)</a>:</h4>
<p>I can get exact commit in a moment</p>



<a name="191652163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652163">(Mar 24 2020 at 18:17)</a>:</h4>
<p>Was it <a href="https://github.com/rust-lang/rust/pull/70087" target="_blank" title="https://github.com/rust-lang/rust/pull/70087">https://github.com/rust-lang/rust/pull/70087</a>?</p>



<a name="191652254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652254">(Mar 24 2020 at 18:18)</a>:</h4>
<p>broke in <a href="https://github.com/rust-lang/rust/commit/342c5f33d097b2dc07a2dbc0ca45a37379d2ff60" target="_blank" title="https://github.com/rust-lang/rust/commit/342c5f33d097b2dc07a2dbc0ca45a37379d2ff60">https://github.com/rust-lang/rust/commit/342c5f33d097b2dc07a2dbc0ca45a37379d2ff60</a></p>



<a name="191652289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652289">(Mar 24 2020 at 18:18)</a>:</h4>
<p>probably that PR?</p>



<a name="191652306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652306">(Mar 24 2020 at 18:18)</a>:</h4>
<p>Yeah looks that way</p>



<a name="191652314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652314">(Mar 24 2020 at 18:18)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="118594">@ecstatic-morse</span></p>



<a name="191652445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652445">(Mar 24 2020 at 18:19)</a>:</h4>
<p>To answer your question, probably yeah. If <code>ctfe-stress-4</code> is breaking, there's probably other crazy CTFE code out there that's going to break too</p>



<a name="191652518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652518">(Mar 24 2020 at 18:20)</a>:</h4>
<p>oh, I meant that as in "bump the step limit in perf"</p>



<a name="191652530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652530">(Mar 24 2020 at 18:20)</a>:</h4>
<p>but bumping it globally seems good</p>



<a name="191652564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652564">(Mar 24 2020 at 18:20)</a>:</h4>
<p>Ah</p>



<a name="191652596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652596">(Mar 24 2020 at 18:21)</a>:</h4>
<p>(can also do both, fwiw)</p>



<a name="191652618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652618">(Mar 24 2020 at 18:21)</a>:</h4>
<p>I didn't realize we had that option.</p>



<a name="191652652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652652">(Mar 24 2020 at 18:21)</a>:</h4>
<p>Bumping it for <code>ctfe-stress-4</code> locally seems like a good first step regardless</p>



<a name="191652668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652668">(Mar 24 2020 at 18:21)</a>:</h4>
<p>sure, we can just edit the perf benchmark to include the attribute</p>



<a name="191652689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191652689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191652689">(Mar 24 2020 at 18:21)</a>:</h4>
<p>suprisingly the error message does not suggest a limit</p>



<a name="191653207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653207">(Mar 24 2020 at 18:25)</a>:</h4>
<p>hm, so the limit is unstable</p>



<a name="191653213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653213">(Mar 24 2020 at 18:25)</a>:</h4>
<p>that seems bad</p>



<a name="191653222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653222">(Mar 24 2020 at 18:25)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0658]: the `#[const_eval_limit]` attribute is an experimental feature
 --&gt; src/lib.rs:2:1
  |
2 | #![const_eval_limit = &quot;1000000&quot;]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #67217 &lt;https://github.com/rust-lang/rust/issues/67217&gt; for more information
  = help: add `#![feature(const_eval_limit)]` to the crate attributes to enable
</pre></div>



<a name="191653294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653294">(Mar 24 2020 at 18:26)</a>:</h4>
<p>then we should definitely bump the default up because that suggests that previously working code on stable could regress?</p>



<a name="191653303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653303">(Mar 24 2020 at 18:26)</a>:</h4>
<p>Ah yeah</p>



<a name="191653366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653366">(Mar 24 2020 at 18:26)</a>:</h4>
<p>I think we should get <code>ctfe-stress-4</code> running again asap so adding the feature attribute seems fine to me</p>



<a name="191653387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653387">(Mar 24 2020 at 18:26)</a>:</h4>
<p>yeah pushing a fix now</p>



<a name="191653392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653392">(Mar 24 2020 at 18:27)</a>:</h4>
<p>But we should think about the fallout of this more</p>



<a name="191653421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653421">(Mar 24 2020 at 18:27)</a>:</h4>
<p>could you open up an issue or comment somewhere?</p>



<a name="191653579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191653579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191653579">(Mar 24 2020 at 18:28)</a>:</h4>
<p>Would re-opening <a href="https://github.com/rust-lang/rust/issues/54384" target="_blank" title="https://github.com/rust-lang/rust/issues/54384">https://github.com/rust-lang/rust/issues/54384</a> be appropriate or should I create a new issue?</p>



<a name="191655513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191655513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191655513">(Mar 24 2020 at 18:44)</a>:</h4>
<p>I would open a new issue</p>



<a name="191659444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191659444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dylan MacKenzie (ecstatic-morse) <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191659444">(Mar 24 2020 at 19:15)</a>:</h4>
<p>I addressed backwards compatibility issues in the summary of <a href="https://github.com/rust-lang/rust/issues/70087" target="_blank" title="https://github.com/rust-lang/rust/issues/70087">#70087</a>, which also had a crater run with 0 regressions. The fact that <code>ctfe-stress-4</code> broke doesn't change my thinking here, since I believe that the likelihood of real world code going over the limit without loops or conditional recursion (both of which require nightly features) is basically zero.</p>



<a name="191764025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191764025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191764025">(Mar 25 2020 at 15:32)</a>:</h4>
<p>so the default limit is 1_000_000 (10^6) and this stress test required 10_000_000 (10^7)? That seems reasonable, the test is extremely silly. I wouldn't increase the default limit for that, I'd say this shows the limit was picked quite reasonably.^^</p>



<a name="191764958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191764958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191764958">(Mar 25 2020 at 15:38)</a>:</h4>
<p>the risk of increasing the limit is just that we run for longer before emitting a warning though right?</p>



<a name="191765026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765026">(Mar 25 2020 at 15:38)</a>:</h4>
<p>I dont think there's a warning any more? we just hard error and abort evaluation</p>



<a name="191765047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765047">(Mar 25 2020 at 15:38)</a>:</h4>
<p>similar to the recursion_limit rustc uses elsewhere</p>



<a name="191765053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765053">(Mar 25 2020 at 15:38)</a>:</h4>
<p>er, yeah, I meant an error</p>



<a name="191765078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765078">(Mar 25 2020 at 15:38)</a>:</h4>
<p>so realistically it feels like we should set it such that no program we know of encounters it</p>



<a name="191765137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765137">(Mar 25 2020 at 15:39)</a>:</h4>
<p>I'd qualify that with "no <em>reasonable</em> program", or at least "no <em>realistic</em> program"</p>



<a name="191765139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765139">(Mar 25 2020 at 15:39)</a>:</h4>
<p>maybe that's not the right policy though, not sure</p>



<a name="191765224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765224">(Mar 25 2020 at 15:39)</a>:</h4>
<p>hm, okay. given the zero regression crater run we're probably fine</p>



<a name="191765335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765335">(Mar 25 2020 at 15:40)</a>:</h4>
<p>if we set it too high, people will see the compiler hang and not know what's going on... not sure how the team decided about the recursion_limit default value, or about requests to increase it</p>



<a name="191765360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765360">(Mar 25 2020 at 15:40)</a>:</h4>
<p>I've certainly seen that value increased in the wild</p>



<a name="191765392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765392">(Mar 25 2020 at 15:40)</a>:</h4>
<p>yeah, me too</p>



<a name="191765428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765428">(Mar 25 2020 at 15:40)</a>:</h4>
<p>ideally we'd be able to "know" apriori that the limit will be reached, but that's obviously not really possible</p>



<a name="191765455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765455">(Mar 25 2020 at 15:40)</a>:</h4>
<p>;)</p>



<a name="191765475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765475">(Mar 25 2020 at 15:41)</a>:</h4>
<p>anyway I'm happy with leaving it as is I guess</p>



<a name="191765526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765526">(Mar 25 2020 at 15:41)</a>:</h4>
<p>kk. and thanks for bringing this up, it's a good data point.</p>



<a name="191765575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765575">(Mar 25 2020 at 15:41)</a>:</h4>
<p>we'll only really get user data "in the wild" once loops are allowed in stable CTFE, I think</p>



<a name="191765956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191765956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191765956">(Mar 25 2020 at 15:43)</a>:</h4>
<p>makes sense</p>



<a name="191766185"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766185" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766185">(Mar 25 2020 at 15:44)</a>:</h4>
<p>I wonder if we could borrow from what bpf(?) in the kernel did for those loops etc -- IIRC, they managed to ensure that things terminate</p>



<a name="191766282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766282">(Mar 25 2020 at 15:45)</a>:</h4>
<p>otoh, even if you will eventually terminate but will run for years we probably want to error out</p>



<a name="191766466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766466">(Mar 25 2020 at 15:46)</a>:</h4>
<p>(e)BPF is... really weird :P</p>



<a name="191766511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766511">(Mar 25 2020 at 15:46)</a>:</h4>
<p>and I don't think it's anything we can replicate anyway</p>



<a name="191766563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766563">(Mar 25 2020 at 15:46)</a>:</h4>
<p>yeah I don't know the details. wouldn't be surprised</p>



<a name="191766726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766726">(Mar 25 2020 at 15:47)</a>:</h4>
<p>also I think it has arbitrary limits too? so it's not like a principled solution or anything</p>



<a name="191766960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191766960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191766960">(Mar 25 2020 at 15:49)</a>:</h4>
<p>(dependently typed aka "proof assistant" languages are the main example I know of that does enforce termination, but it's nothing we can do for miri, as the problem is the turing-complete unsafe-internals Rust code and we can't realistically enforce <em>it</em> will terminate)</p>



<a name="191767215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191767215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191767215">(Mar 25 2020 at 15:50)</a>:</h4>
<p>the way you make an interpreter for some TC imperative thing in one of those languages is with "fuel", i.e. an instruction limit of sorts</p>



<a name="191767379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191767379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191767379">(Mar 25 2020 at 15:51)</a>:</h4>
<p>it works because natural numbers are inductive and you can think of it like uhhh <code>5000</code> is a container that has <code>4999</code> inside which has <code>4998</code> all the way down to <code>2</code> containing <code>1</code> containing <code>0</code> and then it bottoms out</p>



<a name="191767573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191767573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191767573">(Mar 25 2020 at 15:52)</a>:</h4>
<p>so if each step is guaranteed to terminate then doing <code>n: Nat</code> steps is like a list fold, it's <code>n</code> that determines the shape of your execution/termination, <em>not</em> the interpreted code</p>



<a name="191852006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/perf%20stress%20test%20broken/near/191852006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/perf.20stress.20test.20broken.html#191852006">(Mar 26 2020 at 08:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/perf.20stress.20test.20broken/near/191766960" title="#narrow/stream/146212-t-compiler.2Fconst-eval/topic/perf.20stress.20test.20broken/near/191766960">said</a>:</p>
<blockquote>
<p>(dependently typed aka "proof assistant" languages are the main example I know of that does enforce termination, but it's nothing we can do for miri, as the problem is the turing-complete unsafe-internals Rust code and we can't realistically enforce <em>it</em> will terminate)</p>
</blockquote>
<p>it's also not really better than an arbitrary limit, in practice. I can easily write a Coq program that terminates, but not in your lifetime.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>